<%@ page import="cn.NewsDao.NewsDao1" %>
<%@ page import="cn.NewsDaoImpl.NewsDaoImpl1" %>
<%@ page import="cn.entity.News1" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/4/11
  Time: 14:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--
<%
    NewsDao1 newsDao1 = new NewsDaoImpl1();
    List<News1> newsList = newsDao1.getNewsList();
    request.setAttribute("key1",newsList.get(0).getTitle());

%>

    ${key1}

<%
    News1 news1 = new News1();
    news1.setTitle("dfsdfsd");
    request.setAttribute("key2",news1.getTitle());


%>
${key2}



<%



%>
--%>


<% NewsDao1 newsDao1 = new NewsDaoImpl1();
    News1 news1 = newsDao1.selectById(2);
    request.setAttribute("ket1",news1);
    session.setAttribute("ket2",news1);
    application.setAttribute("ket3",news1);
    pageContext.setAttribute("ket4",news1);


%>
<c:out value="${ket1.categoryId +1}"></c:out>
<c:out value="${ket2.id*(10-5)}"></c:out>
<c:out value="${ket3.picPath}"></c:out>
<c:out value="${empty ket4.title}"></c:out>

<hr>
<%

    int[] country = new int[5];
    country[0]=1;
    country[1]=2;
    country[3] = 3;
    request.setAttribute("country", country);



%>




<c:forEach  items="${country }" var="d">
    ${d }
</c:forEach>


<%

    List<String> name = new ArrayList<>();
    name.add("刘德华");
    name.add("张学友");
    name.add("黎明");
    name.add("郭富城");
    pageContext.setAttribute("name", name);



%>

<c:forEach items="${name}" var="n">
    ${n}
    <br>
</c:forEach>








</body>
</html>
